/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GoMail;

/**
 *
 * @author Administrator
 */
public class Filter implements FilterInterface
{
    private String subject;
    private String sender;
    private String directionFolder;
    /**
     * This constructor is used to create new Filter object with given data
     * @param subject message subject
     * @param sender message sender
     * @param directionfolder folder name which message transfer to it directly
     * if you want to set filter only to message subject
     * make message sender empty and vice-versa
     */
    public Filter(String subject, String sender, String directionfolder)
    {
        this.subject = subject;
        this.sender = sender;
        this.directionFolder = directionfolder;
    }
    /**
     * this constructor is used to initialize empty filter
     */
    public Filter()
    {
        subject = "";
        sender = "";
        directionFolder = "";
    }
    /**
     * This method is used to get name of folder where messages will save
     * @return name of specified folder
     */
    public String getDirectionFolder()
    {
        return directionFolder;
    }
    /**
     * This method is used to set name of folder where messages will save
     * @param directionFolder new name of the folder
     */
    public void setDirectionFolder(String directionFolder)
    {
        this.directionFolder = directionFolder;
    }
    /**
     * This method is used to get sender
     * @return sender name
     */
    public String getSender()
    {
        return sender;
    }
    /**
     * This method is used to set sender
     * @param sender new sendr name
     */
    public void setSender(String sender)
    {
        this.sender = sender;
    }
    /**
     * This method is used to get message subject
     * @return message subject
     */
    public String getSubject()
    {
        return subject;
    }
    /**
     * This method is used to set message subject
     * @param subject new message subject
     */
    public void setSubject(String subject)
    {
        this.subject = subject;
    }
    /**
     * This method is used to set all filter data
     * this method is used when filter data is read from file
     * and loaded to filter list in MailUserOperations class
     * @param s array of filter data
     */
    public void setAllFilterData(String[] s)
    {
        this.setSubject(s[0]);
        this.setSender(s[1]);
        this.setDirectionFolder(s[2]);
    }
}
